package com.qf.serevice.impl;

import com.qf.entity.PatientMedicineInfoDetail;
import com.qf.mapper.OrderDetailMapper;
import com.qf.pojo.BaseResult;
import com.qf.serevice.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderDetailServiceImpl implements OrderDetailService {
    BaseResult baseResult = new BaseResult();
    @Autowired
    OrderDetailMapper orderDetailMapper;

    //查询患者订单的详细信息
    @Override
    public BaseResult findByOid(String oid) {
        List<PatientMedicineInfoDetail> byOid = orderDetailMapper.findByOid(oid);
        if (byOid!=null){

            baseResult.setCode(1);
            baseResult.setInfo("查询成功");
            baseResult.setData(byOid);
            return baseResult;
        }else {
            baseResult.setCode(0);
            baseResult.setInfo("查询失败");
        }
        return baseResult;
    }
}
